<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0px;
        }
        body{
            font-family: "微软雅黑", arial;
            font-size: 14px;
        }
        /*两端对齐*/
        .wrap{width: 80%;margin: 50px auto 0px;}
        .content{
            display: table;
            width: 300px;
            height: 300px;
            min-width: 320px;
            max-width: 1000px;
            margin: 10px auto;
            border: 1px solid #333;
        }
        .img-box{
            display: table-cell;
            font-size: 12px;
            width: 100px;
            height:100px;
            border: 1px solid red;
            vertical-align: middle;
            text-align: center;
            background: lightblue;
        }
        
    </style>
</head>
<body>
    <div class="wrap">
       <p>让元素垂直水平居中</p>
        <div class="content">
            <div class="img-box">
                <p>hsfsjdhnfsjknf</p>
            </div>
        </div>
    </div>

    
</body>
</html>